
function now(){return (new Date()).valueOf();}

var jQueryCSV = require('../jquery.csv-0.7.js');
var jsCSVTester = require('../javascript-csv-tester.js');

var jsCSV = require('../javascript-csv.js');
var nCSV = require('../javascript-ncsv.js');

exports.testData = function(test){
    var testCSV = jsCSVTester.genCSV(500,[10,"firstName","lastName","favoriteCar","favoriteColors"]);

    var startQ = now();
    var jQueryCSVExpected = jQueryCSV.csv.toArrays(testCSV);;
    console.log("Q:"+ (now() - startQ) );
    
    var startJS = now();
    var jsCSVExpected = (jsCSV.parse(testCSV)).data;
    console.log("JS:"+ (now() - startJS) );
    test.deepEqual(jsCSVExpected,jQueryCSVExpected,"data generated by different parsers should be the same");

    var startN = now();
    var nCSVExpected = (nCSV.parse(testCSV)).data;
    console.log("N:"+ (now() - startN) );
    test.deepEqual(jsCSVExpected,nCSVExpected,"data generated by different parsers should be the same");
    test.done();
};


